package cn.v2tila.rsosa.student.service.serviceImpl;

import cn.v2tila.rsosa.student.entity.FollowEntity;
import cn.v2tila.rsosa.student.jpa.FollowJPA;
import cn.v2tila.rsosa.student.service.FollowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author v2tila on 23:58 2019/3/26
 */
@Service
public class FollowServiceImpl implements FollowService {
    @Autowired
    private FollowJPA followJPA;
    @Override
    public List<FollowEntity> findByUniqueId(String uniqueId) {
        return followJPA.findByUniqueId(uniqueId);
    }

    @Override
    public FollowEntity saveAndFlush(FollowEntity followEntity) {
        return followJPA.saveAndFlush(followEntity);
    }

    @Override
    public boolean existsByUniqueIdAndZpxxId(String uniqueId, Integer zpxxId) {
        return followJPA.existsByUniqueIdAndZpxxId(uniqueId,zpxxId);
    }

    @Override
    public FollowEntity findByUniqueIdAndZpxxId(String uniqueId, Integer zpxxId) {
        return followJPA.findByUniqueIdAndZpxxId(uniqueId,zpxxId);
    }

    @Override
    public void delete(FollowEntity followEntity) {
        followJPA.delete(followEntity);
    }

}
